#pragma once

#include "math/box2d.h"
#include "muduo/base/Timestamp.h"

#include "rclcpp/rclcpp.hpp"

#include <memory>
#include <mutex>

namespace decision::adas {

class Vehicle {
public:
    explicit Vehicle(int64_t id);

    int64_t trackid() const;
    double x() const;
    double y() const;
    double heading() const;
    double length() const;
    double width() const;

    std::string debug_string() const;

    double distance(const Vehicle& other) const;
    double azimuth(const Vehicle& other) const;

    void update(double x, double y, double hea, double length, double width);

    muduo::Timestamp get_update_time();

protected:
    rclcpp::Logger logger_;

private:
    int64_t trackid_;
    std::unique_ptr<decision::math::Box2d> box2d_;
    muduo::Timestamp update_time_;
    std::mutex lock_;
};

} // namespace decision::adas
